import java.util.Scanner;

public class n4 {
	public static void main(String[] args) {
	
    int array[] = new int[10];
    double r;
    int a = 0;
    int b = 0;
    int c = 0;
    for (int j = 0; j < 10; j++) {
    	r=Math.random();
    	if (r < 0.3) {
    		array[j] = 3;
    		a++;    		
    	}
    	else if (r < 0.6) {
    		array[j] = 7;
    		b++;
    	}
    	else if (r <= 1) {
    		array[j] = 9;
    		c++;
    	}
    	System.out.print(array[j] + " ");
    }
     
    System.out.println("Number of 3: " + a);
    System.out.println("Number of 7: " + b);
    System.out.println("Number of 9: " + c);
}
}
